import request from '../utils/requestAdmin'

//登录
export function login({email,password,checkPass}) {
  return request.post('admin/login',{email,password,checkPass})
}

//获取用户列表
export function getUserList(page,page_size){
  return request.get('admin/user/get?page='+page+'&page_size='+page_size)
}

//设为管理
export function setAdmin({id}) {
    return request.post('admin/add',{id})
}

//移除管理
export function deleteAdmin({id}) {
  return request.post('admin/delete',{id})
}

//修改用户
export function modifyUser({id,email,name,sign}) {
  return request.post('admin/user/modify',{id,email,name,sign})
}

//删除用户
export function deleteUser({id}) {
    return request.post('admin/user/delete',{id})
}

//获取视频列表
export function getVideoList(page,page_size){
  return request.get('admin/video/get?page='+page+'&page_size='+page_size)
}

//修改视频
export function modifyVideo({id,title,content,isShow}) {
  return request.post('admin/video/modify',{id,title,content,isShow})
}

//删除视频
export function deleteVideo({id}) {
  return request.post('admin/video/delete',{id})
}

//获取通知
export function getAnnounceList(page,page_size){
  return request.get('admin/announce/get?page='+page+'&page_size='+page_size)
}

//删除通知
export function deleteAnnounce({id}) {
  return request.post('admin/announce/delete',{id})
}

//添加通知
export function addAnnounce({title,content,url}) {
  return request.post('admin/announce/add',{title,content,url})
}

//获取轮播图
export function getCarouselList(){
  return request.get('carousel/get')
}

//添加轮播图
export function addCarousel({title,img,url}) {
  return request.post('admin/carousel/upload',{title,img,url})
}

//删除轮播图
export function deleteCarousel(id) {
  return request.post('admin/carousel/delete',{id})
}